using Microsoft.EntityFrameworkCore;

namespace Ef_Core_learn;

public class MyContext: DbContext
{
    // public DbSet<Blog> Blog { get; set; }
    public DbSet<RssBlog> RssBlog { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        // optionsBuilder.UseMySql("""
        //                         server=localhost;
        //                         port=3306;
        //                         user=root;
        //                         password=rootroot;
        //                         database=efcore-learn_test
        //                         """,
        //     ServerVersion.Parse("8.4.3-mysql"));
        
        optionsBuilder.UseSqlite("""
                                 Data Source=C:\Users\18103\RiderProjects\chengheng-net\Ef-Core-learn\efcore-learn_test.db
                                 """);
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<RssBlog>().UseTpcMappingStrategy();
        // modelBuilder.Entity<Blog>().HasDiscriminator().IsComplete(false);
    }

    protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
    {
        configurationBuilder.Properties<>()
    }
}